const initialState = {
  token: "",
  userName: "",
  userInfo: "",
  menus: [],
  states: false,
};

export default (state = initialState, { type, payload }) => {
  switch (type) {
    case "typeName":
      return { ...state, ...payload };
    case "set_user":
      // console.log(payload);
      return { ...state, ...payload };
    case "set_token":
      console.log(payload);
      return { ...state, ...payload };
    case "change_store":
      console.log(payload);
      return { ...state, ...payload };
    case "promise":
      console.log(payload);
      // return { ...state, ...payload };
      return state;

    default:
      return state;
  }
};
